package com.huonan.service.itemservice.controller;

import com.huonan.service.itemservice.domain.Item;
import com.huonan.service.itemservice.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author huonan
 * @date 2020/2/27 16:58
 * @desc
 */
@RestController
public class ItemController {
    @Autowired
    private ItemService itemService;

    @GetMapping("/item/{id}")
    public Item getItem(@PathVariable("id") int id) {
        return itemService.queryItemById(id);
    }
}
